define(['jquery'], function() {

    var ue;
    return {
        init: function() {

            ue = UE.getEditor('editor');
            var id = $("#hidNewsID").val();
            if (!id) return;
            $.ajax({
                type: 'get',
                url: '/admin/news/select?id=' + id,
                success: function(data) {

                    var news = data;
                    if (news) {
                        $("#inpTitle").val(news.title);
                        $("#inpAuthor").val(news.author);
                        $("#inpSource").val(news.source);
                        $("#inpSourceUrl").val(news.sourceUrl);
                        $("#inpIntroduce").val(news.introduce);
                        setTimeout(function() {
                            UE.getEditor('editor').setContent(news.content, false);
                        }, 500);
                    }
                }
            });
        }
    };

});